package com.lzy.mrdark.util;


import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;

public class SimpleTextWatcher implements TextWatcher {

	private View view;
	public SimpleTextWatcher(View view){
		this.view = view;
	}
    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
	    int after) {
    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    	if(view!=null)
    	view.setVisibility(TextUtils.isEmpty(s) ? View.INVISIBLE
                : View.VISIBLE);
    }

    @Override
    public void afterTextChanged(Editable s) {
    }

}
